]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
dash: reload favorites when the installed app change
authorGiovanni Campagna <gcampagn@redhat.com>
Tue, 27 Aug 2013 12:00:26 +0000 (14:00 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sat, 31 Aug 2013 16:55:24 +0000 (18:55 +0200)
Force a reload of the favorite system, to pick apps that were
uninstalled.

https://bugzilla.gnome.org/show_bug.cgi?id=706878

js/ui/appFavorites.js
js/ui/dash.js

index 2c572d02205946c055a1b64f1369ba4eb453d29d..b3896213ce7513c715e731200386afee765d3ec6 100644 (file)
@@ -14,15 +14,15 @@ const AppFavorites = new Lang.Class({
     _init: function() {
         this._favorites = {};
         global.settings.connect('changed::' + this.FAVORITE_APPS_KEY, Lang.bind(this, this._onFavsChanged));
-        this._reload();
+        this.reload();
     },
 
     _onFavsChanged: function() {
-        this._reload();
+        this.reload();
         this.emit('changed');
     },
 
-    _reload: function() {
+    reload: function() {
         let ids = global.settings.get_strv(this.FAVORITE_APPS_KEY);
         let appSys = Shell.AppSystem.get_default();
         let apps = ids.map(function (id) {
index 03ceb82ee3c9c5c5579b89c23115f8adb9669534..3e45c32f6cac08c00f579c897278e203bc40a9f1 100644 (file)
@@ -423,7 +423,10 @@ const Dash = new Lang.Class({
 
         this._appSystem = Shell.AppSystem.get_default();
 
-        this._appSystem.connect('installed-changed', Lang.bind(this, this._queueRedisplay));
+        this._appSystem.connect('installed-changed', Lang.bind(this, function() {
+            AppFavorites.getAppFavorites().reload();
+            his._queueRedisplay();
+        }));
         AppFavorites.getAppFavorites().connect('changed', Lang.bind(this, this._queueRedisplay));
         this._appSystem.connect('app-state-changed', Lang.bind(this, this._queueRedisplay));